package com.study;
//{12.9,53.54,75.0,99.1,3.14} 找出数组中的最小值并打印
public class Demo04 {

    public static void main(String[] args) {
        double[] dArray = {12.9,53.54,75.0,99.1,3.14};
        double min = dArray[0];
        for(int i=0;i < dArray.length ; i++){
            min = compareToGetmin(min, dArray[i]);
        };
        System.out.println("数组最小值为：" + min);
    }
    public static double compareToGetmin(double num1, double num2){
        return num1 > num2 ? num2 : num1;
    }
}
